home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Python-1.4 / Docs / Amiga / amiga_module next >
Text File  |  1998-06-24  |  5KB  |  162 lines

  1.  
  2.  
  3.                                AMIGA MODULE
  4.  
  5.                       Irmen de Jong - ijong@gak.nl
  6.                                27 dec. 1996
  7.  
  8.  
  9. This document describes the builtin module `amiga'. This is the Amiga version
  10. of the `posix' module which is used on Unix. You should not directly import
  11. this module! Always use module `os' instead.
  12.  
  13. Functions in `amiga' module:
  14.  
  15.     chdir
  16.     chmod
  17.     chown
  18.     close
  19. (*) dup        (needs bsdsocket.library for actual use)
  20. (*) dup2    (needs bsdsocket.library for actual use)
  21.     fdopen
  22.     fstat
  23. (*) fullpath
  24.     getcwd
  25.     getegid    (requires usergroup.library)
  26.     geteuid    (requires usergroup.library)
  27.     getgid    (requires usergroup.library)
  28.     getpgrp    (requires usergroup.library)
  29. (*) getpid
  30.     getuid    (requires usergroup.library)
  31.     link    (will use usergroup.library if present)
  32.     listdir
  33.     lseek
  34.     lstat
  35. (*) mkdir    (will use usergroup.library if present)
  36.     open
  37.     popen
  38.     putenv
  39.     read
  40.     readlink
  41.     remove
  42.     rename
  43.     rmdir
  44.     setgid    (requires usergroup.library)
  45.     setsid    (requires usergroup.library)
  46.     setuid    (requires usergroup.library)
  47.     stat
  48.     symlink
  49.     system
  50.     umask    (requires usergroup.library)
  51.     unlink
  52.     utime
  53.     write
  54.  
  55.   NOT SUPPORTED ARE:
  56.     execv, execve, _exit, fork, getppid, kill, nice, pipe,
  57.     times, uname, wait, waitpid.
  58.  
  59.   DATA MEMBERS: (Items marked (*): see below, ABOUT ENVIRONMENT)
  60. (*) environ
  61.     error
  62. (*) globalvars
  63. (*) shellaliases
  64. (*) shellvars
  65.  
  66.  
  67. For  documentation,  see  docs  on  posix  module.   Items  marked  (*) are
  68. different from the ones in the posix module and are described below.
  69.  
  70. Note   that   some   functions   require   AmiTCP   (bsdsocket.library)  or
  71. usergroup.library.   If  you  don't  have  it,  you'll  get  a  SystemError
  72. exception.   Some  functions  work better with usergroup.library but do not
  73. require it.
  74.  
  75.  
  76.   dup  &  dup2
  77.   ~~~~~~~~~~~~
  78. Currently  only  socket  filedescriptors  can be dup'ed.  If you want to do
  79. this, you will need bsdsocket.library (AmiTCP).
  80.  
  81.   fullpath
  82.   ~~~~~~~~
  83. New function.  Returns the full pathname of a file/directory (i.e.  expands
  84. assigns).    Implemented  here  but  don't  use  it  directly,  always  use
  85. os.path.fullpath (amigapath imports this function).
  86.  
  87.   getpid
  88.   ~~~~~~
  89. Currently  the  memory  address  of  the process structure (FindTask(0)) is
  90. taken as pid.
  91.  
  92.   mkdir
  93.   ~~~~~
  94. Since Python 1.4, the protection mode can be omitted. It defaults to 0777.
  95.  
  96.  
  97.  
  98. ABOUT FILESYSTEM LINK SUPPORT
  99. -----------------------------
  100.  
  101. (Functions: link, symlink, readlink)
  102.  
  103. You can make hardlinks and softlinks, using link and symlink, respectively.
  104. You  can  read the value of a symbolic (soft) link using readlink.  Keep in
  105. mind  that  the  filesystem  must  support links (2.04+ FFS does) All three
  106. functions are designed for compatibility with their Posix equivalents.
  107.  
  108. NOTE:  because of implementation issues, readlink fails when passing only a
  109. device  name  as argument.  This is not a big problem (devices can never be
  110. links anyway).
  111.  
  112.  
  113.  
  114. ABOUT ENVIRONMENT VARIABLES
  115. ---------------------------
  116.  
  117. I made up an extensive but CGI script compatible (and compatible with other
  118. scripts  that expect a Unix system) environment handling system.  Thanks to
  119. Mike Meyer (mwm@contessa.phone.net) for helping me out on the problems with
  120. the old system.
  121.  
  122.     Environment variable dictionaries
  123.     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  124. os.environ       - contains BOTH GLOBAL (ENV:) AND LOCAL (shell) variables
  125.                    If a variable occurs both as global and as local var,
  126.                    the local value has higher prioriy.
  127. os.globalvars    - contains ONLY GLOBAL (ENV:) variables
  128. os.shellvars     - contains ONLY LOCAL (shell) variables
  129.  
  130. IMPORTANT:   changes  made  to the environment variables in os.environ will
  131. now    also    be    made    in    ENV:.    This   means   the   assignment
  132. os.environ['PAGER']='c:more'  will  now  also  set the environment variable
  133. ENV:PAGER  to "c:more".  This feature was introduced in Python version 1.4.
  134. Note  however  that  an  assignment  to a variable in os.environ that was a
  135. local  shell-var  does  NOT  result  in updating the shell variable:  a new
  136. global  variable  with  the same name will be created.  If this is not what
  137. you  want, check out the `environment' module.  Note well that the above is
  138. not  true  for  os.globalvars  and os.shellvars:  they remain read-only and
  139. changes are not propagated to the environment.
  140.  
  141.     The new function: putenv
  142.     ~~~~~~~~~~~~~~~~~~~~~~~~
  143. Python  1.4  introduced a new function in the posix module:  putenv.  So in
  144. our  case  the  amigamodule now also contains this function.  Portable code
  145. should  use  this function (os.putenv), but Amiga specific code can use the
  146. environment module, mentioned below.
  147.  
  148.     Aliases
  149.     ~~~~~~~
  150. Shell   aliases   can   be   accessed  in  the  os.shellaliases  dictionary
  151. (read-only).
  152.  
  153.  
  154.     The `environment' module
  155.     ~~~~~~~~~~~~~~~~~~~~~~~~
  156. This  module  contains a bunch of environment handling functions.  Read the
  157. document `environment_module' for a description of this module.
  158.  
  159.  
  160.  
  161. SEE ALSO: os module
  162.